/**
  ******************************************************************************
  * @file    bs32f1xx.h
  * @author  MCU Application Team
  * @brief   CMSIS BS32F1xx Device Peripheral Access Layer Header File.
  ******************************************************************************
*/

/** @addtogroup CMSIS
  * @{
  */

/** @addtogroup bs32f1xx
  * @{
  */

#ifndef BS32F1xx_H
#define BS32F1xx_H

#ifdef __cplusplus
 extern "C" {
#endif /* __cplusplus */

/** @addtogroup Library_configuration_section
  * @{
  */


/**
  * @brief CMSIS Device version number $VERSION$
  */
#define __BS32F1xx_CMSIS_VERSION_MAIN   (0x01U) /*!< [31:24] main version */
#define __BS32F1xx_CMSIS_VERSION_SUB1   (0x00U) /*!< [23:16] sub1 version */
#define __BS32F1xx_CMSIS_VERSION_SUB2   (0x00U) /*!< [15:8]  sub2 version */
#define __BS32F1xx_CMSIS_VERSION_RC     (0x00U) /*!< [7:0]  release candidate */
#define __BS32F1xx_CMSIS_VERSION        ((__BS32F1xx_CMSIS_VERSION_MAIN << 24)\
                                        |(__BS32F1xx_CMSIS_VERSION_SUB1 << 16)\
                                        |(__BS32F1xx_CMSIS_VERSION_SUB2 << 8 )\
                                        |(__BS32F1xx_CMSIS_VERSION_RC))

/**
  * @}
  */

/** @addtogroup Device_Included
  * @{
  */
#if defined (BS32F103xx)
  #include "bs32f103xx.h"
#else
  #error "Please select first the target BS32F1xx device used in your application (in bs32f1xx.h file)"
#endif 
/**
  * @}
  */

/** @addtogroup Exported_types
  * @{
  */
typedef enum
{
  RESET = 0,
  SET = !RESET
} FlagStatus, ITStatus;

typedef enum
{
  DISABLE = 0,
  ENABLE = !DISABLE
} FunctionalState;
#define IS_FUNCTIONAL_STATE(STATE) (((STATE) == DISABLE) || ((STATE) == ENABLE))

typedef enum
{
  SUCCESS = 0,
  ERROR = !SUCCESS
} ErrorStatus;

/**
  * @}
  */


/** @addtogroup Exported_macros
  * @{
  */
#define SET_BIT(REG, BIT)     ((REG) |= (BIT))

#define CLEAR_BIT(REG, BIT)   ((REG) &= ~(BIT))

#define READ_BIT(REG, BIT)    ((REG) & (BIT))

#define CLEAR_REG(REG)        ((REG) = (0x0))

#define WRITE_REG(REG, VAL)   ((REG) = (VAL))

#define READ_REG(REG)         ((REG))

#define MODIFY_REG(REG, CLEARMASK, SETMASK)  WRITE_REG((REG), (((READ_REG(REG)) & (~(CLEARMASK))) | (SETMASK)))

/**
  * @}
  */


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* BS32F1xx_H */
/**
  * @}
  */

/**
  * @}
  */




/************************ (C) COPYRIGHT BSMicroelectronics *****END OF FILE****/
